package wc.model;

import wc.model.component.Component;
import wc.model.component.MallComponent;
import wc.model.component.MallRoom;
import wc.model.component.roomcomponent.RoomComponent;
import wc.model.grid.TileGrid;

public class SimpleFloor extends Floor<MallComponent> {

	public SimpleFloor(TileGrid<MallComponent> grid) {
		super(grid);
	}
	
	@Override
	public boolean addComponent(Component component, int x, int y) {
		Component c = tileGrid.getComponent(x, y);
		if(c instanceof MallRoom && component instanceof RoomComponent) {
			MallRoom mallRoom = (MallRoom) c;
			int[] loc = tileGrid.getOriginalLocationByComponent((MallComponent) c);
			x = x - loc[0];
			y = y - loc[1];
			return mallRoom.addRoomComponent(x, y, (RoomComponent) component);
		}
		return tileGrid.addComponent(x, y, (MallComponent) component);
	}

	@Override
	public void removeComponent(int X, int Y) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void removeComponent(Component component) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void deleteAll() {
		// TODO Auto-generated method stub
		
	}
}
